package com.bgs.service.impl;

import com.bgs.mapper.AppMapper;
import com.bgs.pojo.Approve;
import com.bgs.pojo.Employee;
import com.bgs.vo.ApproveVo;
import com.bgs.service.appService;
import com.bgs.tool.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppServiceImpl implements appService {

    @Autowired
    private AppMapper appMapper;
    @Override
    public R insertaddrz(ApproveVo approve) {
        int i =appMapper.insertaddrz(approve);
        return R.ok().data("i",i);
    }

    @Override
    public R selectmineemp(Integer eid) {
        List<ApproveVo> list = appMapper.selectmineemp(eid);

        return R.ok().data("list",list);
    }

    @Override
    public R selectInfo() {
        List<Employee> list =appMapper.selectInfo();
        return R.ok().data("list",list);
    }

    @Override
    public R selectapr(Integer eid) {
        List<ApproveVo> list = appMapper.selectapr(eid);
        System.out.println(list+"--------------------------------------------------------");
        return R.ok().data("list",list);
    }

    @Override
    public R selectById(Integer id) {
        List<ApproveVo> list =appMapper.selectById(id);
        return R.ok().data("list",list);
    }

    @Override
    public Boolean updatesp(Integer id,Integer spid) {
        int i =appMapper.updatesp(id,spid);
        if (i>0){
            return true;
        }
        return false;

    }

    @Override
    public R selectcc(Integer eid) {
        List<ApproveVo> list =appMapper.selectcc(eid);
        return R.ok().data("list",list);
    }


}
